import numpy as np
import operator
import kNN
import pandas as pd

'''
一个失败的尝试
'''

def create_data_set():
    data=pd.read_csv("players_data.csv")
    names=data['name']
    height=data['height']
    weight=data['weight']
    features=np.array([height,weight]).T
    labels=data['labels']
    return features,labels

if __name__ == '__main__':
    features,labels=create_data_set()
    test_input=[0.17,0.6]
    for i in np.arange(0,1,0.1):
        for j in np.arange(0,1,0.1):
            input=[i,j]
            print(i,j,kNN.classify(input,features,labels,3))

    res=kNN.classify(test_input,features,labels,3)
    print(res)